<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page session="true" %>

<script>
function guest_cart(prdcd, sapcd, price, maxqty, corpno) {
	addCart(prdcd, sapcd, 1, price, maxqty, corpno);
}

function member_cart(prdcd, sapcd, price, maxqty, corpno) {
	saveCart(prdcd, sapcd, 1, price, maxqty, corpno);
}
</script>

<form name="frmCart" method="post" action="/vhmall/cart.vh">
	<input type="hidden" name="prdcd" value="" />
</form>
	<!-- 콘텐츠 영역 -->
    <div id="BodyWrap">
    	<c:if test="${sessionScope.member_id!=null}">
    	<div class="main_couponarl">
        	<p>${member_name} 님에게 <a href="#" style="color:#e42526;">5</a>개의 쿠폰이 있습니다.</p>
            <a href="#" class="btncloseio" title="닫기">닫기</a>
        </div>
        </c:if>
        <section>
            <h3>특가찬스 상품 목록</h3>
            <div id="ContentWrap1">
                <ul class="showwindow_list1">
                	<c:forEach items="${requestScope.itemList }" var="items" varStatus="status">
                    <li>
                        <a href="${contextPath}/vhmall/item_detail.vh?prdcd=${items.PRDCD}" class="thumb">
                            <img src="http://www.vhmall.co.kr/inc/imgLoad.jsp?dirName=product/${items.CORPNO}/&fileName=${items.PRDIMG1_ENC}&thumb=Y&quality=100&size=230" />
                        </a>
                        <div class="windowinfo_area">
                            <a href="${contextPath}/vhmall/item_detail.vh?prdcd=${items.PRDCD}" class="title">
                            	<span style="color:#e42526;font-weight:bold;">${items.PREPROMOTE}</span>
                            	${items.PRDNM }
                            	<span style="color:#666;">${items.ENDPROMOTE}</span></a>
                            </a>
                            <p class="price">
                            	<c:if test="${items.CPNPRC!=null}">
	                                <span class="discount"><em>${items.SELPRC}</em>원</span>
	                                ${items.CPNPRC}원
                                </c:if>
                                <c:if test="${items.CPNPRC==null}">
                                	${items.SELPRC}원
                                </c:if>
                            </p>
                            <p class="btnposition_box">
                            	<c:choose>
									<c:when test="${ sessionScope.member_id == null }">
	                        			 <a href="javascript:guest_cart('${items.PRDCD}', '${items.SAPCD}', '${items.SELPRC}', '${items.LMTORDCNT}', '${items.CORPNO}');" class="btn_inlistyle1 gradation_gray1" title="장바구니" >
		                                    <span class="btncon_r comimg icon_cart"></span>
		                                   	 장바구니
		                                </a>
									</c:when>
									<c:otherwise>
	                        			<a href="javascript:member_cart('${items.PRDCD}', '${items.SAPCD}', '${items.SELPRC}', '${items.LMTORDCNT}', '${items.CORPNO}');" class="btn_inlistyle1 gradation_gray1" title="장바구니">
		                                    <span class="btncon_r comimg icon_cart"></span>
		                                   	 장바구니
		                                </a>
									</c:otherwise>
								</c:choose>
								<!-- 기존 PC버젼에도 없던것으로 기능구현이 애매하여 임시 막음
                                <a href="#" class="btn_inlistyle1 gradation_gray1 ftc_darkred" title="찜하기">
                                    <span class="btncon_r comimg icon_heart"></span>
                                    찜하기
                                </a>
                                 -->
                            </p>
                        </div>
                    </li>
                   	</c:forEach>
                </ul>
            </div>
        </section>
        <!--// 콘텐츠 영역 -->